﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Editor.aspx.cs" Inherits="ElectronicJournal.Editor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT [dbo].[aspnet_Roles].RoleId, [dbo].[aspnet_UsersInRoles].UserId, [dbo].[aspnet_UsersInRoles].RoleId, [dbo].[aspnet_Users].UserName,  [dbo].[aspnet_Membership].Email FROM [dbo].[aspnet_Roles], [dbo].[aspnet_UsersInRoles],  [dbo].[aspnet_Users],  [dbo].[aspnet_Membership] WHERE [dbo].[aspnet_Roles].RoleName = 'Reviewer' AND [dbo].[aspnet_UsersInRoles].RoleId = [dbo].[aspnet_Roles].RoleId AND  [dbo].[aspnet_Users].UserId = [dbo].[aspnet_UsersInRoles].UserId AND  [dbo].[aspnet_Membership].UserId = [dbo].[aspnet_UsersInRoles].UserId"></asp:SqlDataSource>
<table>
<tbody>
<td>
    <table id="table1" runat="server" style="background:Azure; ">
        <tbody>
            <tr>
                <td>
                   <asp:LinkButton OnClick="ShowJournalPanel" runat="server">Журнал</asp:LinkButton>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:LinkButton OnClick="ShowPatternPanel" runat="server">Шаблоны</asp:LinkButton>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:LinkButton OnClick="ShowPublicationsPanel" runat="server">Публикации</asp:LinkButton>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:LinkButton OnClick="ShowReviewersPanel" runat="server">Рецензенты</asp:LinkButton>
                </td>
            </tr>
        </tbody>
    </table>
</td>
<td/>
<td>
    <asp:Panel ID="JournalPanel" runat="server" Visible="false">
        div1
    </asp:Panel>
    <asp:Panel ID="PatternPanel" runat="server" Visible="false">
        div2<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </asp:Panel>
    <asp:Panel ID="PublicationsPanel" runat="server" Visible="false">
        <table id="Table2" runat="server" >
            <tbody>
                <tr>
                    <td>
                        <asp:LinkButton OnClick="ShowPublicationsUploader" BackColor="Azure" runat="server">Загрузить публикации</asp:LinkButton>   
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Panel ID="PublicationsUploaderTable" runat="server" Visible="false" BorderStyle="Solid">
                            <table>
                                <tbody>
                                    <tr>
                                        <td/>
                                        <td>
                                            Название публикации:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="PublicationsTextBox" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td />
                                        <td>
                                            Файл публикации:
                                        </td>
                                        <td>
                                           <asp:FileUpload ID="PublicationsUploader" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td />
                                        <td>
                                            <asp:Button Text="Загрузить" OnClick="UploadPublication" runat="server" />
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </asp:Panel>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:LinkButton OnClick="ShowPublicationsList" runat="server">Список публикаций</asp:LinkButton>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Panel ID="PublicationsListTable" runat="server" Visible="false" BorderStyle="Solid">
                            <asp:Table ID="PublicationsTable" runat="server" />
                        </asp:Panel>
                    </td>
                </tr>
            </tbody>
        </table>
    </asp:Panel>
    <asp:Panel ID="ReviewersPanel" runat="server" Visible="false">
        <asp:GridView ID="ReviewersGridView" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="UserId,RoleId1" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="RoleId" HeaderText="RoleId" Visible="false" 
                    SortExpression="RoleId" />
                <asp:BoundField DataField="UserId" HeaderText="UserId" ReadOnly="True" Visible="false"
                    SortExpression="UserId" />
                <asp:BoundField DataField="RoleId1" HeaderText="RoleId1" ReadOnly="True" Visible="false"
                    SortExpression="RoleId1" />
                <asp:BoundField DataField="UserName" HeaderText="UserName" 
                    SortExpression="UserName" />
                <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            </Columns>
        </asp:GridView>
    </asp:Panel>
</td>
</tbody>
</table>
</asp:Content>
